{% extends 'empcms/super.html'%}
{% block temp_tit %}
     <title>department</title>
{% endblock %}
{% block tit %}
    {% load static %}
    <div id="rightheader">
        <p id="myp">
            <span>欢迎您：{{ username }}&nbsp;&nbsp;&nbsp;2009/11/20</span><img id="head_img" src="{% static user_pic  %}" />
            <br />
        </p>
    </div>
{% endblock %}
{% block  empcms%}

    <script>
        function del(id){
            var s=confirm("是否确定删除？");
            if(s){
                location.href="{% url 'dept:deptdel' %}?id="+id;
            }
        }
    </script>
<div id="content">
        <link rel="stylesheet" type="text/css" href="/static/css/common.css" />
        <p id="whereami">
        </p>
        <h1>
            Welcome!
        </h1>
        <table class="table">
            <tr class="table_header">
                <td>
                    ID
                </td>
                <td>
                    部门名称
                </td>
                <td>
                    备注
                </td>
                <td>
                    操作
                </td>
            </tr>
            {% for dept in depts%}
                {% if  forloop.counter|divisibleby:'2'  %}
                    <tr class="row2">
                {% else %}
                <tr class="row1">
                {% endif %}
                <td>
                    {{ dept.id }}
                </td>
                <td>
                    {{ dept.name }}
                </td>
                <td>
                     {{ dept.note }}
                </td>
                <td>
                    <a href="{%  url 'emp:empdetail' %}?num=1&deptId={{ dept.id }}">详情</a>
                    <a href="javascript:void(0)" onclick="del({{ dept.id }})">删除</a>&nbsp;
                    <a href="{%url 'dept:deptuptp' %}">修改</a>
                </td>
            </tr>
            {% endfor %}
        </table>
        <p>
            <input type="button" class="button" value="添加部门" onclick="location='{%url 'dept:deptaddp' %}'"/>
        </p>
    </div>
{% endblock %}